Auto merge of #3118 - cbiffle:master, r=alexcrichton
authorbors <bors@rust-lang.org>
Mon, 26 Sep 2016 17:10:18 +0000 (10:10 -0700)
committerGitHub <noreply@github.com>
Mon, 26 Sep 2016 17:10:18 +0000 (10:10 -0700)
commit231dce6ad4a08a0365f29a5a62051881ef192ee4
treec8412745a47beed727a743281b37a3d4139c8242
parent2755b3af5222b885d00d8f623085afdd736eb95a
parentcf5640aa7380fd5838a65c6567989dc9ecc9359d
Auto merge of #3118 - cbiffle:master, r=alexcrichton

Fall back to fs::copy when hard_link fails.

Some filesystems don't allow hard links.  Since Cargo's use of hard
links is an optimization, and not necessary for correctness, it can fall
back to a file copy when hard linking is not available.

This is one possible solution to #3098.

Caveat: this will try to copy if the hard link fails *for any reason*.
It's not clear that there's a more surgical way of handling this; Unix
tends to indicate the condition as "permission denied," not with a
granular "links not supported by filesystem" error.